BigDFT.Fragments module
This module contains data structures for describing fragments. Fragments are orders lists of atoms.
- distance(i, j, cell=None)[source]
Distance between fragments, defined as distance between center of mass
- pairwise_distance(i, j, cell=None)[source]
Distance between fragments, as defined by the distance between their two nearest atoms.
- lineup_fragment(frag)[source]
Align the principal axis of inertia of the fragments along the coordinate axis. Also shift the fragment such as its centroid is zero.
- Parameters
(BigDFT.Fragments.Fragment) – the fragment to transform.
- Returns
the transformed fragment.
- Return type
- class RotoTranslation(frag1, frag2)[source]
Define a transformation which can be applied to a fragment. This rotation is defined by giving this class two fragments, and the rototranslation between those fragments is automatically computed.
- Parameters
frag1 (BigDFT.Fragments.Fragment) – the first position.
frag2 (BigDFT.Fragments.Fragment) – the second position.
- dot(frag)[source]
Apply the rototranslations on a fragment.
- Parameters
frag (BigDFT.Fragments.Fragment) – the fragment to rototranslate.
- Returns
the rototranslated fragment.
- Return type
- class Translation(t)[source]
This class defines a simple translation.
- Parameters
t (list) – the vector describing the translation.
- class Rotation(R)[source]
This class defines a simple rotation.
- Parameters
t (list) – the vector describing the rotation.
- interpolate_fragments(A, B, steps, extrapolation_steps=0)[source]
Given two fragments A and B, this generates a list of Fragments that interpolate between A and B in a specified number of steps.
- Parameters
A (BigDFT.Fragments.Fragment) – starting fragment.
B (BigDFT.Fragments.Fragment) – ending fragment.
steps (int) – the number of steps to take between A and B.
extrapolation_steps (int) – optionally, we can extrapolate a number of steps beyond B on the same trajectory.
- Returns
a list of fragments interpolating between A and B including A and B.
- Return type
(list)
- class Fragment(atomlist=None, xyzfile=None, posinp=None, astruct=None, system=None)[source]
A fragment is a list of atoms in a system. Fragment might have quantities associated to it, like its electrostatic multipoles (charge, dipole, etc.) and also geometrical information (center of mass, principla axis etc.). A Fragment might also be rototranslated and combined with other moieteies to form a
BigDFT.Systems.Systems
.- Parameters
atomlist (list) – list of atomic dictionaries defining the fragment
xyzfile (BigDFT.IO.XYZReader) – an XYZ file to read from.
posinp (dict) – the posinp style dictionary from a logfile/input file.
astruct (dict) – a BigDFT atomic structure style dictionary.
system (BigDFT.Systems.System) – a BigDFT system, esssentially this reduces many fragments into a single fragment.
Todo
Define and describe if this API is also suitable for solid-state fragments
- serialize(name, units='bohr')[source]
Transform the fragment in a list that can be employed for the construction of dataframes or pandas series.
- property centroid
The center of a fragment.
- center_of_charge()[source]
The charge center which depends both on the position and net charge of each atom.
- property q0
Provides the global monopole of the fragments given as a sum of the monopoles of the atoms.
- d0(center=None)[source]
Fragment dipole, calculated only from the atomic charges.
- Parameters
center (list) – the center of charge of the fragment. If this is not present, the centroid is used.
- d1(center=None)[source]
Fragment dipole including the atomic dipoles.
- Parameters
center (list) – the center of charge of the fragment. If this is not present, the centroid is used.
- get_external_potential(units='bohr', charge_offset=False)[source]
Transform the fragment information into a dictionary ready to be put as an external potential.
- get_net_force()[source]
Returns the net force on a fragment in Ha/Bohr.
- Returns
(list) Three values which describe the net force.
- property nel
The number of valence electrons of the atoms of the fragment